/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialog_NhapTenThuMuc.java
 *
 * Created on 17-06-2009, 13:44:59
 */

package doanlythuyet_javaoutlook.MyUserControl;

import javax.swing.JOptionPane;

/**
 *
 * @author ShineShiao
 */
public class JDialog_NhapTenThuMuc extends javax.swing.JDialog {
    private String m_TenThuMuc = "";
    /** Creates new form JDialog_NhapTenThuMuc */
    public JDialog_NhapTenThuMuc(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    public String getTenThuMuc(){
        return m_TenThuMuc;
    }
    JDialog_NhapTenThuMuc() {
        
        throw new UnsupportedOperationException("Not yet implemented");

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jTextField_TenThuMuc = new javax.swing.JTextField();
        jButton_Chon = new javax.swing.JButton();
        jButton_HuyBo = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(doanlythuyet_javaoutlook.DoAnLyThuyet_JavaOutLookApp.class).getContext().getResourceMap(JDialog_NhapTenThuMuc.class);
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jTextField_TenThuMuc.setText(resourceMap.getString("jTextField_TenThuMuc.text")); // NOI18N
        jTextField_TenThuMuc.setName("jTextField_TenThuMuc"); // NOI18N

        jButton_Chon.setText(resourceMap.getString("jButton_Chon.text")); // NOI18N
        jButton_Chon.setName("jButton_Chon"); // NOI18N
        jButton_Chon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_ChonActionPerformed(evt);
            }
        });

        jButton_HuyBo.setText(resourceMap.getString("jButton_HuyBo.text")); // NOI18N
        jButton_HuyBo.setName("jButton_HuyBo"); // NOI18N
        jButton_HuyBo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_HuyBoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton_HuyBo)
                        .addGap(18, 18, 18)
                        .addComponent(jButton_Chon))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(18, 18, 18)
                        .addComponent(jTextField_TenThuMuc, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(26, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(52, 52, 52)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextField_TenThuMuc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_Chon)
                    .addComponent(jButton_HuyBo))
                .addContainerGap(32, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_ChonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_ChonActionPerformed
        // TODO add your handling code here:
        if(jTextField_TenThuMuc.getText().equals("")){
            JOptionPane.showMessageDialog(null, "Phải nhập tên thư mục !!!" );
            System.exit(0);
        }
        else{
            m_TenThuMuc= jTextField_TenThuMuc.getText();
            this.dispose();
        }
        
    }//GEN-LAST:event_jButton_ChonActionPerformed

    private void jButton_HuyBoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_HuyBoActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_jButton_HuyBoActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                JDialog_NhapTenThuMuc dialog = new JDialog_NhapTenThuMuc(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton_Chon;
    private javax.swing.JButton jButton_HuyBo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JTextField jTextField_TenThuMuc;
    // End of variables declaration//GEN-END:variables

}
